package com.hunan.api.catv.entity.enums;


public enum FilesStateEnum {

    invalid(0, "已下线"),

    normal(1, "正常访问"),

    process(2, "处理中"),

    under_audit(3, "待审核");

    private final Integer code;

    private final String value;


    FilesStateEnum(Integer code, String value) {
        this.code = code;
        this.value = value;
    }

    public Integer getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

    public static FilesStateEnum getResult(int code) {
        FilesStateEnum[] rcs = FilesStateEnum.values();
        for (FilesStateEnum rc : rcs) {
            if (rc.getCode() == code) {
                return rc;
            }
        }
        return null;
    }

    public static String getValue(String code) {
        FilesStateEnum[] rcs = FilesStateEnum.values();
        for (FilesStateEnum rc : rcs) {
            if (rc.getCode().toString().equals(code)) {
                return rc.getValue();
            }
        }
        return null;
    }
}
